From: Ian Campbell Date: Wed, 25 Oct 2006 12:58:30 +0000 (+0100) Subject: PV-on-HVM: Include compatibility kzalloc implementation for kernels X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15584^2~6 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=4a154f7453f2de0094505d13757c080345a5868e;p=xen.git PV-on-HVM: Include compatibility kzalloc implementation for kernels before 2.6.14. Signed-off-by: Ian Campbell Signed-off-by: K. Y. Srinivasan Signed-off-by: Tsunehisa Doi --- diff --git a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h index 6c08dad47d..219382c3c1 100644 --- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h @@ -41,4 +41,8 @@ unsigned long wait_for_completion_timeout(struct completion *x, unsigned long ti signed long schedule_timeout_interruptible(signed long timeout); #endif +#if defined(_LINUX_SLAB_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +void *kzalloc(size_t size, int flags); +#endif + #endif diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c index f7c8db7fcd..f3cef11620 100644 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -97,3 +98,19 @@ signed long schedule_timeout_interruptible(signed long timeout) } EXPORT_SYMBOL(schedule_timeout_interruptible); #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +/** + * kzalloc - allocate memory. The memory is set to zero. + * @size: how many bytes of memory are required. + * @flags: the type of memory to allocate. + */ +void *kzalloc(size_t size, int flags) +{ + void *ret = kmalloc(size, flags); + if (ret) + memset(ret, 0, size); + return ret; +} +EXPORT_SYMBOL(kzalloc); +#endif